package com.sziit.se.highconcurrency.order.application.feignclient;

import com.sziit.se.highconcurrency.common.result.DataResult;
import com.sziit.se.highconcurrency.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

//当不启用eureka时，可用url方式直接指定访问地址
//@FeignClient(name = "user-service", url = "http://${user-service.nodeIp}:6868")

//当部署了eureka时，不用指定url，通过eureka注册中心做服务发现
@FeignClient(value = "user-service")
public interface UserFeign {

    @GetMapping("/user/query-by-id")
    DataResult getUserById(@RequestHeader("Authorization") String token, @RequestParam(value = "userId") String userId);
}
